<template>
    <div>
        <el-backtop :visibility-height="200" target=".content"></el-backtop>
        <div class="crumbs">
            <div class="contentbox">
                <div class="contentsize">租金管理(交款)</div>
                <div>
                    <el-button @click="cacelsubmitForm('ruleForm')">返回</el-button>
                </div>
            </div>
        </div>
        <div class="container">
            <div class="addtitle">房屋信息</div>
            <!-- <div class="detailcontent">
                <div class="detailitem1">{{ buildvalue.fwdz }}</div>
                <div class="detailitem">管房单位：{{ buildvalue.gfdw }}</div>
                <div class="detailitem">档案编号：{{ buildvalue.dabh }}</div>
                <div class="detailitem">房屋性质：{{ buildvalue.fwyt }}</div>
                <div class="detailitem">房屋结构：{{ buildvalue.fwjg }}</div>
                <div class="detailitem">产权单位：{{ buildvalue.cqdw }}</div>
                <div class="detailitem">建筑面积：{{ buildvalue.jzmj }}</div>
                <div class="detailitem">建筑年代：{{ buildvalue.jznd }}</div>
                <div class="detailitem">建筑形式：{{ buildvalue.jzxs }}</div>
                <div class="detailitem"></div>
            </div> -->
            <el-descriptions :column="3" border size="medium" :labelStyle="rowCenter"
                        :contentStyle="contentCenter" v-for="(item,index) in buildvalue" :key="index">
                <el-descriptions-item label="房屋地址：">{{ item.fwdz }}</el-descriptions-item>
                <el-descriptions-item label="管房单位：">{{ item.gfdw }}</el-descriptions-item>
                <el-descriptions-item label="档案编号：">{{ item.dabh }}</el-descriptions-item>
                <el-descriptions-item label="房屋性质：">{{ item.fwyt }}</el-descriptions-item>
                <el-descriptions-item label="管房单位：">{{ item.gfdw }}</el-descriptions-item>
                <!-- <el-descriptions-item label="房屋结构：">{{ item.fwjg }}</el-descriptions-item> -->
                <el-descriptions-item label="产权单位：">{{ item.cqdw }}</el-descriptions-item>
                <el-descriptions-item label="建筑面积：">{{ item.jzmj }}</el-descriptions-item>
                <!-- <el-descriptions-item label="建筑年代：">{{ item.jznd }}</el-descriptions-item> -->
                <el-descriptions-item label="管理方式：">{{ item.glfs }}</el-descriptions-item>
                <el-descriptions-item label="产别：">{{ item.cb }}</el-descriptions-item>
                <!-- <el-descriptions-item label="建筑形式：">{{ item.jzxs }}</el-descriptions-item> -->
                <el-descriptions-item></el-descriptions-item>
            </el-descriptions>
            <div class="addtitle" style="margin-top: 10px;">租户信息</div>
            <!-- <div class="detailcontent">
                <div class="detailitem">承租人：{{ form.czr }}</div>
                <div class="detailitem">承租人联系方式：{{ form.czrlxfs }}</div>
                <div class="detailitem">证件名称：{{ form.zjmc }}</div>
                <div class="detailitem">证件号码：{{ form.zjhm }}</div>
                <div class="detailitem">联系地址：{{ form.lxdz }}</div>
                <div class="detailitem"></div>
            </div> -->
            <el-descriptions :column="3" border size="medium" :labelStyle="rowCenter"
                        :contentStyle="contentCenter">
                <el-descriptions-item label="承租人：">{{ form.czr }}</el-descriptions-item>
                <el-descriptions-item label="承租人联系方式：">{{ form.czrlxfs }}</el-descriptions-item>
                <el-descriptions-item label="证件名称：">{{ form.zjmc }}</el-descriptions-item>
                <el-descriptions-item label="证件号码：">{{ form.zjhm }}</el-descriptions-item>
                <el-descriptions-item label="联系地址：">{{ form.lxdz }}</el-descriptions-item>
                <el-descriptions-item></el-descriptions-item>
            </el-descriptions>
            <div class="addtitle" style="margin-top: 10px;">合同信息</div>
            <!-- <div class="detailcontent">
                <div class="detailitem">合同编号：{{ form.htbh }}</div>
                <div class="detailitem">合同签订日期：{{ form.qdsj ? form.qdsj.split(' ')[0] : '' }}</div>
                <div class="detailitem">出租面积：{{ form.czmj }}</div>
                <div class="detailitem">合同起始日期：{{ form.zlqssj ? form.zlqssj.split(' ')[0] : '' }}</div>
                <div class="detailitem">合同终止日期：{{ form.zldqsj ? form.zldqsj.split(' ')[0] : '' }}</div>
                <div class="detailitem">合同金额：{{ form.htje }}</div>
                <div class="detailitem">减免金额：{{ form.jmje }}</div>
                <div class="detailitem">减免原因：{{ form.jmyy }}</div>
                <div class="detailitem">设备清单：{{ form.sbqd }}</div>
                <div class="detailitem">预收金额：{{ bjdetail.ysje }}</div>
                <div class="detailitem">当欠金额：{{ bjdetail.dqje }}</div>
                <div class="detailitem"></div>
            </div> -->
            <el-descriptions :column="3" border size="medium" :labelStyle="rowCenter"
                        :contentStyle="contentCenter">
                <el-descriptions-item label="合同编号：">{{ form.htbh }}</el-descriptions-item>
                <el-descriptions-item label="合同签订日期：">{{ form.qdsj ? form.qdsj.split(' ')[0] : ''  }}</el-descriptions-item>
                <el-descriptions-item label="出租面积：">{{ form.czmj }}</el-descriptions-item>
                <el-descriptions-item label="合同起始日期：">{{ form.zlqssj ? form.zlqssj.split(' ')[0] : '' }}</el-descriptions-item>
                <el-descriptions-item label="合同终止日期：">{{ form.zldqsj ? form.zldqsj.split(' ')[0] : ''}}</el-descriptions-item>
                <el-descriptions-item label="月租金：">{{ form.zjdj }}</el-descriptions-item>
                <el-descriptions-item label="减免金额：">{{ form.jmje }}</el-descriptions-item>
                <el-descriptions-item label="减免原因：">{{ form.jmyy }}</el-descriptions-item>
                <el-descriptions-item label="设备清单：">{{ form.sbqd }}</el-descriptions-item>
                <el-descriptions-item label="预收金额：">{{ bjdetail.ysje }}</el-descriptions-item>
                <el-descriptions-item label="当欠金额：">{{ bjdetail.dqje }}</el-descriptions-item>
                <el-descriptions-item label="已缴押金金额：">{{ bjdetail.yjyjje }}</el-descriptions-item>
                <el-descriptions-item label="押金：">{{ form.yj }}</el-descriptions-item>
                <el-descriptions-item label="押金收缴日期：">{{ form.yjrq? form.yjrq.substring(0,7): '' }}</el-descriptions-item>
            </el-descriptions>
            <div class="addtitle" style="margin-top: 10px;">交款信息</div>
            <div class="detailcontent">
                <el-form :inline="true" :model="projectdetail" class="demo-form-inline" label-position="right" size="small"
                    label-width="140px">
                    <el-form-item label="交返款：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-select v-model="projectdetail.jfk" placeholder="请选择交返款" @change="getjfkvalue($event)"
                                style="width: 100%;">
                                <el-option v-for="item in jfklist" :key="item.code" :label="item.name" :value="item.code">
                                </el-option>
                            </el-select>
                        </div>
                    </el-form-item>
                    <el-form-item label="税前金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-input v-model="projectdetail.sqje" placeholder="请输入税前金额" class="search-input"
                                @blur="getseval" style="width: 100%;">
                            </el-input>
                        </div>
                    </el-form-item>
                    <el-form-item label="税额(9%)：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-input v-model="projectdetail.she" placeholder="请输入税额" class="search-input"
                                style="width: 100%;"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item label="税后金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-input v-model="projectdetail.shje" placeholder="请输入税后金额" class="search-input"
                                style="width: 100%;"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item label="收租方式：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-select v-model="projectdetail.zjlb" placeholder="请选择收租方式" style="width: 100%;">
                                <el-option v-for="item in jzlblist" :key="item.code" :label="item.name" :value="item.code">
                                </el-option>
                            </el-select>
                        </div>
                    </el-form-item>
                    <el-form-item label="支票号：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-input v-model="projectdetail.zph" placeholder="请输入支票号：" class="search-input"
                                style="width: 100%;"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item label="日期：" style="width: 32%;">
                        <el-date-picker type="date" placeholder="选择日期" v-model="projectdetail.jkrq"
                            value-format="yyyy-MM-dd"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="备注：" style="width: 100%;">
                        <el-input type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入备注" v-model="projectdetail.bz"
                            style="width: 900px;">
                        </el-input>
                    </el-form-item>
                </el-form>
            </div>
            <div class="addtitle">补缴信息</div>
            <div class="detailcontent">
                <el-form :inline="true" :model="bjdetail" class="demo-form-inline" label-position="right" size="small"
                    label-width="140px">
                    <el-form-item label="旧欠金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            {{ bjdetail.jqje }}
                        </div>
                    </el-form-item>
                    <el-form-item label="本次补缴旧欠金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-input v-model="tjdetail.bjqje" placeholder="请输入本次补缴旧欠金额" class="search-input"
                                style="width: 100%;" @change="bjqpd"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item style="width: 32%;"></el-form-item>
                    <el-form-item label="已缴其他金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            {{ bjdetail.yjqtje }}
                        </div>
                    </el-form-item>
                    <el-form-item label="缴其他金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-input v-model="tjdetail.jqtje" placeholder="请输入缴其他金额：" class="search-input"
                                style="width: 100%;"></el-input>
                        </div>
                    </el-form-item>
                    <el-form-item style="width: 32%;"></el-form-item>
                    <el-form-item label="未缴押金金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            {{ bjdetail.wjyjje }}
                        </div>
                    </el-form-item>
                    <el-form-item label="缴押金金额：" style="width: 32%;">
                        <div style="width: 220px;">
                            <el-input v-model="tjdetail.jyjje " placeholder="请输入缴押金金额" class="search-input" style="width: 100%;"></el-input>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
            <div class="addtitle">缴费信息</div>
            <div>
                <div style="overflow: hidden;">
                    <el-table :data="tableData" border :header-cell-style="{
                        background: '#f8fbff',
                        color: '#173686',
                        border: '0',
                    }" style="width: 100%" size="mini" :row-style="{ height: '20px' }"
                        :cell-style="{ padding: '0px' }">
                        <el-table-column prop="year" label="年份" align="center"> </el-table-column>
                        <el-table-column prop="month" label="月份" align="center"> </el-table-column>
                        <el-table-column label="月应缴金额" align="center" prop="yyjje"></el-table-column>
                        <el-table-column label="减免金额" align="center" prop="jmje"></el-table-column>
                        <el-table-column label="待缴金额" align="center" prop="yjje"></el-table-column>
                        <el-table-column label="已收取金额" align="center" prop="ysqje"></el-table-column>
                        <el-table-column label="交款金额" align="center" prop="jkje">
                            <template slot-scope="scope">
                                <div class="noBor">
                                    <span v-if="scope.row.yjje == 0">--</span>
                                    <el-input v-model="scope.row.jkje" placeholder="请输入交款金额" v-else></el-input>
                                </div>
                            </template>
                        </el-table-column>
                    </el-table>
                    <el-button type="primary" @click="gettime(projectdetail.sqje, form.yzj, tjdetail.bjqje, tjdetail.jqtje,tjdetail.jyjje)"
                        style="float:right;margin-top: 14px;">按年月分配交款金额</el-button>
                </div>
                <div style="margin: 14px auto;width:270px">
                    <!-- :disabled="showtj" -->
                    <el-button type="primary" @click="submittwojk">保存</el-button>
                    <el-button type="primary" @click="yzysubmit">预转已</el-button>
                    <el-button @click="cacelsubmitForm('ruleForm')">返回</el-button>
                </div>
                <div class="addtitle">过往缴费记录</div>
                <el-table :data="jftabledata" style="width: 100%" :header-cell-style="tableHeaderColor"
                    :row-style="tablerowColor" border>
                    <el-table-column prop="jkrq" label="交款日期" align="center">
                        <template slot-scope="scope">
                            <div class="noBor">
                                {{ scope.row.jkrq ? scope.row.jkrq.split(' ')[0] : '' }}
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="sqje" label="实收金额" align="center"> </el-table-column>
                    <el-table-column prop="she" label="扣税(9%)" align="center"> </el-table-column>
                    <el-table-column prop="shje" label="实收金额(税后)" align="center"> </el-table-column>
                    <el-table-column prop="ysqje" label="已收金额" align="center"> </el-table-column>
                    <el-table-column prop="ysje" label="预收金额" align="center"> </el-table-column>
                    <el-table-column prop="yzyje" label="预转已金额" align="center"> </el-table-column>
                    <el-table-column prop="bjqje" label="补旧欠金额" align="center"> </el-table-column>
                    <el-table-column prop="jqtje" label="缴其他金额" align="center"> </el-table-column>
                    <el-table-column prop="jyjje" label="缴押金金额" align="center"> </el-table-column>
                    <el-table-column prop="bz" label="备注" align="center"> </el-table-column>
                </el-table>
                <!-- <div class="pagination" style="float: right">
                    <el-pagination background layout="total,prev, pager, next,jumper" :total="total" :current-page.sync="current"
                        :page-size="pageSize" @current-change="handleCurrentChange">
                    </el-pagination>
                </div> -->
            </div>
        </div>
    </div>
</template>
<script>
import { builddetail, signlistdetail, jfzjlist, jfxzadd, jflist, xzzjupdate, bzfupdatezjjfinfo, bzfyzyinfo, bzfgetjfxq } from '@/api/index';
import global from '@/components/common/httpurl.vue'
import valueList from '@/components/common/valueList.vue'
export default {
    name: 'zjgladd',
    data() {
        return {
            contentCenter: {
                'min-width': '230px',   //最小宽度
                'word-break': 'break-all'  //过长时自动换行
            },
            rowCenter: {
                "text-align": "right", "width": "230px"
            },
            sbqd: [],//设备清单
            showtj: true,
            total: 0,
            current: 1,
            pageSize: 10,
            jksjow: true,//交款内容
            tableData: [],//缴费信息
            jftabledata: [],//过往缴费记录
            newtable: [],//计算过后的新数组
            httpUrl: global.httpUrl,//公共地址
            jfklist: valueList.jfklist,//交返款
            jkfslist: valueList.jkfslist,//交款方式
            jzlblist: valueList.jzlblist,//收租方式
            filefileList: [],//文件列表
            fileListshandle: [],
            // 请求表头信息
            myHeaders: {
                'token': localStorage.getItem('token')
            },
            form: {
                create_name: "",
                create_name_id: "",
                create_time: "",
                current: 0,
                fcbl: "",
                fj: '',
                glfs: '',
                id: "",
                note: "",
                pageSize: 0,
                qsrq: "",
                relid: "",
                status_code: 1,
                stgldw: "",
                type: "",
                update_name: "",
                update_name_id: "",
                update_time: "",
                wtdw: "",
                zzrq: ""
            },
            fileList: [],
            fromlist: [],
            projectdetail: {
                jfk: '1',//交返款 1：交款 2：返款 ,
                she: 0,//税额
                shje: 0,//税后金额 
                sqje: 0,//税前金额
                zjlb: '',//收租方式 
                zph: '',//支票号
                jkrq: '',//交款日期
                bz: '',//备注
                status_code: 1,
                zjList: []
            },
            buildvalue: {},
            // 缴费信息
            jfform: {
                bz: '',// 备注 ,
                create_name: '',//创建人 ,
                create_name_id: '',// 创建人id ,
                create_time: '',//创建时间 ,
                current: 0,//第几页 ,
                id: '',// id ,
                jfk: '1',//交返款 1：交款 2：返款 ,
                jkrq: '',//交款日期 ,
                pageSize: 10,//每页数量 ,
                she: '',//税额 ,
                shje: '',//税后金额 ,
                signid: '',//合同ID ,
                sqje: '',//税前金额 ,
                status_code: '1',//1正常 2删除 ,
                update_name: '',//修改人 ,
                update_name_id: '',//修改人id ,
                update_time: '',//修改时间 ,
                zjlb: '',//收租方式 ,
                zph: '',//支票号
            },
            // 缴费列表表单
            jflistform: {
                bz: '',//备注 ,
                create_name: '',//创建人 ,
                create_name_id: '',//创建人id ,
                create_time: '',//创建时间 ,
                current: 1,//第几页 ,
                id: '',//id ,
                jfk: '1',//交返款 1：交款 2：返款 ,
                jkrq: '',//交款日期 ,
                pageSize: 10,//每页数量 ,
                she: '',//税额 ,
                shje: '',//税后金额 ,
                signid: '',//合同ID ,
                sqje: '',//税前金额 ,
                status_code: '1',//1正常 2删除 ,
                update_name: '',//修改人 ,
                update_name_id: '',//修改人id ,
                update_time: '',//修改时间 ,
                zjlb: '',//收租方式 ,
                zph: '',//支票号
            },
            signid: '',
            bjdetail: {},
            tjdetail: {
                bjqje: 0,
                jqtje: 0,
                jyjje:0,
                jzsje:0//增收
            }
        };
    },
    methods: {
        // 判断补旧欠金额大小
        bjqpd() {
            if (this.bjdetail.jqje < this.tjdetail.bjqje) {
                this.tjdetail.bjqje = this.bjdetail.jqje
            }
        },
        // 列表样式
        tableHeaderColor({ row, column, rowIndex, columnIndex }) {
            if (rowIndex === 0) {
                return 'background-color: #f7f7f7;color:black;height: 54px;font-weight: 500;font-size:14px;font-variant:tabular-nums'
            }
        },
        tablerowColor({ row, rowIndex }) {
            return 'height: 42px;font-size:14px;'
        },
        // 获取税额
        getseval() {
            // 网上找的计算方法
            // 税前金额 除以 (1+9%)的 商再乘以9% 可以得到税额 
            // 税前金额 除以 (1+9%)的 商 为税后金额
            this.projectdetail.she = ((this.projectdetail.sqje / (1.09)) * 0.09).toFixed(2)
            this.projectdetail.shje = (this.projectdetail.sqje / (1.09)).toFixed(2)
        },
        // 月份划分(列表数据计算)
        gettime(zje, myje, yjqt, dqje,jyjje) {
            var that = this
            let zjeqs = zje - (Number(yjqt) + Number(dqje)+Number(jyjje)) //获取总金额
            let changetable = [] //获取到新数组
            // 交钱交少了还是只会少交和刚刚好交
            for (let i = 0; i < this.tableData.length; i++) {
                // 交款金额 小于 应缴金额时
                // 当 应缴金额 小于 税前总金额-前一条应缴金额 时 交款金额等于应缴金额
                // 交款金额 大于 应缴金额时 交款金额 等于 循环减去应缴金额的税前总金额
                console.log(that.tableData)
                if (that.tableData[i].jkje <= that.tableData[i].yjje) {
                    console.log('小于总金额')
                    if (that.tableData[i].yjje <= zjeqs) {
                        that.tableData[i].jkje = that.tableData[i].yjje.toFixed(2)
                        console.log(that.tableData[i].jkje)
                        zjeqs = zjeqs - that.tableData[i].jkje
                        changetable.push(that.tableData[i])
                        that.newtable = changetable
                        console.log('changetable', changetable)
                        this.showtj = false
                    } else {
                        console.log('zjeqs', zjeqs)
                        that.tableData[i].jkje = parseFloat(zjeqs).toFixed(2)
                        changetable.push(that.tableData[i])
                        that.newtable = changetable
                        this.showtj = false
                        return
                    }
                }else{
                    console.log(132465789)
                }
            }
        },
        // 取消
        cacelsubmitForm() {
            this.$router.go(-1);
        },
        // 获取交付款值
        getjfkvalue(value) {
            console.log(value)
            if (value == '返款') {
                this.jksjow = false
            } else {
                this.jksjow = true
            }
        },
        // 租金交款详情页
        bzfgetjfxq(data) {
            bzfgetjfxq(data).then(res => {
                this.bjdetail = res.data
                this.buildvalue = res.data.buildinfo;
                this.form = res.data.signInfo;
                this.jftabledata = res.data.jfList;
                this.tableData = res.data.ndzjList;
                this.bjdetail.wjyjje=parseFloat(this.form.yj)-parseFloat(this.bjdetail.yjyjje)
            })
        },
        // 委托运营详情
        jygldetail(data) {
            jygldetail(data).then((res) => {
                this.form = res.data;
                this.fromlist = res.data.fj;
                console.log(this.form.fj)
            });
        },
        // 楼幢详情
        builddetail(data) {
            builddetail(data).then((res) => {
                this.buildvalue = res.data;
            });
        },
        // 合同详情
        signlistdetail(data) {
            signlistdetail(data).then((res) => {
                this.form = res.data;
                this.sbqd = this.form.sbqd.split(',')
            });
        },
        // 合同详情租金列表
        jfzjlist(data) {
            jfzjlist(data).then((res) => {
                this.tableData = res.data.records;
            });
        },

        // 新增缴费信息
        jfxzadd(data) {
            jfxzadd(data).then((res) => {
                console.log(res)
            });
        },
        // 缴费租金列表
        jflist(data) {
            jflist(data).then((res) => {
                this.jftabledata = res.data.records;
                this.total = res.data.total
            });
        },
        // 换页
        handleCurrentChange(val) {
            this.current = val;
            this.jflistform.current = val;
            this.jflist(this.jflistform);
            console.log(val);
        },
        // 新增租金信息
        xzzjupdate(data) {
            xzzjupdate(data).then((res) => {
                console.log(res)
            });
        },
        // 缴费信息提交(提交信息和列表)
        bzfupdatezjjfinfo(data) {
            bzfupdatezjjfinfo(data).then((res) => {
                if (res.code == 200) {
                    // 缴费信息提交后刷新俩列表
                    // let zjdata = {
                    //     signid: this.signid
                    // }
                    // this.jfzjlist(zjdata)
                    // this.current = 1;
                    // this.jflistform.current = 1;
                    // this.jflist(this.jflistform)
                    this.bzfgetjfxq(this.signid)
                    this.projectdetail = {
                        jfk: '1',//交返款 1：交款 2：返款 ,
                        she: 0,//税额
                        shje: 0,//税后金额 
                        sqje: 0,//税前金额
                        zjlb: '',//收租方式 
                        zph: '',//支票号
                        jkrq: '',//交款日期
                        bz: '',//备注
                        status_code: 1,
                        zjList: []
                    }
                    this.tjdetail.bjqje = 0
                    this.tjdetail.jqtje = 0
                    this.tjdetail.jyjje = 0
                    this.showtj = true
                    location.reload()
                } else {
                    this.$message.error('操作错误，请核对数据！！')
                }
                console.log(res)
            });
        },
        //保存按钮
        submittwojk() {
            var that = this
            if (this.projectdetail.zjlb) {
                this.projectdetail.signid = this.signid
                console.log(that.newtable)
                // 算上交的总金额 判断修改后的总额是否大于税前金额
                let zongnum = 0;
                for (var i = 0; i < that.newtable.length; i++) {
                    zongnum = zongnum + parseFloat(that.newtable[i].jkje);
                }
                console.log('zongnum', zongnum)
                console.log('sqje', Number(that.projectdetail.sqje)+ Number(0.1))
                let jbjje = Number(zongnum) + Number(that.tjdetail.bjqje) + Number(that.tjdetail.jqtje)+ Number(that.tjdetail.jyjje)
                // 减去俩值得到的新值（本次补缴旧欠金额，已缴其他金额）
                if (jbjje <= (Number(that.projectdetail.sqje)+ Number(0.1))) {
                    that.projectdetail.zjList = that.newtable
                    that.projectdetail.bjqje = that.tjdetail.bjqje ? that.tjdetail.bjqje : 0
                    that.projectdetail.jqtje = that.tjdetail.jqtje ? that.tjdetail.jqtje : 0
                    that.projectdetail.jyjje = that.tjdetail.jyjje ? that.tjdetail.jyjje : 0
                    console.log('projectdetail', that.projectdetail)
                    that.bzfupdatezjjfinfo(that.projectdetail)
                } else {
                    that.$message.error('交款总额不能大于税前金额，请核对');
                }
            } else {
                that.$message.error('请补全数据');
            }
        },
        yzysubmit() {
            let data = {
                current: 0,
                pageSize: 0,
                signlist: [{ id: this.signid }]
            }
            // 预转已接口
            bzfyzyinfo(data).then(res => {
                if (res.code == 200) {
                    this.$message.success('提交成功')
                    // 预转已提交后刷新俩列表
                    // let zjdata = {
                    //     signid: this.signid
                    // }
                    // this.jfzjlist(zjdata)
                    // this.current = 1;
                    // this.jflistform.current = 1;
                    // this.jflist(this.jflistform)
                    // 总的详情页
                    this.bzfgetjfxq(this.signid)
                }
            })
        },
        // 获取当前年月日
        getNowDate() {
            var now = new Date();
            var year = now.getFullYear(); //得到年份
            var month = now.getMonth(); //得到月份
            var date = now.getDate(); //得到日期
            var hour = " 00:00:00"; //默认时分秒 如果传给后台的格式为年月日时分秒，就需要加这个，如若不需要，此行可忽略
            month = month + 1;
            month = month.toString().padStart(2, "0");
            date = date.toString().padStart(2, "0");
            this.projectdetail.jkrq = `${year}-${month}-${date}`;
        },

    },
    created() {
        this.signid = this.$route.query.signid
        this.bzfgetjfxq(this.signid)
        console.log(this.$route.query)
        this.getNowDate()
        // let data = {
        //     id: this.$route.params.id
        // };
        // this.builddetail(data);
        // let htdata = {
        //     id: this.$route.params.signid
        // }
        // this.signlistdetail(htdata)
        // let zjdata = {
        //     signid: this.$route.params.signid,
        // }
        // this.jfzjlist(zjdata)
        // console.log('params', this.$route.params)
        // 缴费列表
        // this.jflistform.signid = this.$route.params.signid
        // this.jflist(this.jflistform)
    }
};
</script>
<style>
.el-upload-list {
    width: 60%;
}

.el-upload--text {
    width: auto;
    height: 80px;
    overflow: hidden;
    border: none;
}
</style>
<style scoped>
.container {
    overflow: hidden;
}

.crumbs {
    background-color: #fff;
    padding: 20px 20px;
}

.indexTitle {
    margin-bottom: 20px;
}

.contentbox {
    display: flex;
    justify-content: space-between;
}

.contentsize {
    font-size: 18px;
    font-weight: 700;
    line-height: 32px;
    color: #606266;
}

.handle-box {
    overflow: hidden;
}

.addtitle {
    width: 100%;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 20px;
    box-sizing: border-box;
    margin-bottom: 20px;
    font-weight: 700;
}

.buttonCenter {
    width: 12%;
    margin: auto;
}

.unloadTitle {
    text-align: left;
    padding-bottom: 10px;
    box-sizing: border-box;
    color: #606266;
}

/* 搜索按钮 */
.searchcolor {
    background-color: #7090ff;
}

.detailcontent {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.detailcontent .detailitem {
    /* float: left; */
    width: 33%;
    margin-bottom: 30px;
}

.detailcontent .detailitem1 {
    /* float: left; */
    width: 99%;
    margin-bottom: 30px;
    font-weight: 700;
    color: #008A94;
}

.detailcontent .detailitem2 {
    /* float: left; */
    width: 99%;
    margin-bottom: 30px;
}

/* 项目文件 */
.filebox {
    text-align: center;
    margin-right: 10px;
    cursor: pointer;
}

.fileboxitem:hover {
    color: #7090ff;
}

.deleteitem {
    color: red;
}

.deleteitem:hover {
    color: #eeeeee;
}
</style>